﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddProducts.aspx.cs" Inherits="Add_products_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Staff Controler</title>
    <link type="text/css" rel="stylesheet" href="Style.css" />
    <link rel="stylesheet" type="text/css" href="../index/Webshop.css" />
    <link rel="stylesheet" type="text/css" href="../index/menubar.css" />
    <style type="text/css">
        .auto-style1 {
            width: 508px;
            border-top:none;
        }
        .auto-style2 {
            width: 480px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">

          <div id="Group">
            
            <img alt="Group2" src="../picture/Group2.png" />
        </div>
        <div id="Login">
                        
            <asp:Button ID="BtnLogin" runat="server" Width="102px" cssclass="login" OnClick="BtnLogin_Click" Text="Log In" Height="34px" />
                            
            <asp:Button ID="BtnLogout" runat="server" CssClass="login" OnClick="BtnLogout_Click1" Text="Log Out" Visible="False" Width="103px" Height="34px" />
            
            <asp:Button ID="BtnOrder" runat="server"   Width="103px" Text="Order" CssClass="logout" Height="34px" Visible="True" OnClick="BtnOrder_Click" />
                            
            <asp:Button ID="btnRedirect" runat="server" OnClick="btnRedirect_Click" Visible="False" Width="103px" Text="Account" CssClass="logout" Height="34px" />
            
        </div>
       
        <!------------Menubar-------------------------->
        <div id="menubar">
            <ul class="menu">

                <li><a href="../index/index.aspx">Home</a></li>
                <li><a href="../Contact/About us.aspx">Avenger team</a></li>      
                <li><a href="../Product/Product.aspx">Our Product</a></li>
                <li><a href="../Contact/Contact us.aspx">Contact</a></li>
            </ul>
        </div>
        <!------------end menubar -------------------->

    <div id="all">
        <div id="head">
            <div id="user">
                <img src="user.png" />
            </div>
        </div>
        <!------------header------------------------->
        <div id="tab">
               <table style="margin-left:280px; margin-right: 280px;" class="auto-style1">
                    <tr>
                        <td class="auto-style2"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label ID="Label1" runat="server" Text="PID"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:TextBox ID="txtPid" runat="server" Width="122px"></asp:TextBox>
    
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    
    
        <asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label5" runat="server" Text="Price"></asp:Label>
            &nbsp;&nbsp; :
            <asp:TextBox ID="txtPrice" runat="server" Width="122px"></asp:TextBox>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="lblStocked" runat="server" Text="Stocked"></asp:Label>
            &nbsp;&nbsp;&nbsp; :
            <asp:TextBox ID="txtStoked" runat="server"></asp:TextBox>
        </p>
        <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            Description&nbsp; :&nbsp; <asp:TextBox ID="txtDes" runat="server" Width="279px"></asp:TextBox>
        </p>
        <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label7" runat="server" Text="Image" ></asp:Label>
            &nbsp;&nbsp;
            &nbsp;<asp:FileUpload ID="FileUpload1" runat="server" Width="316px" />
        </p>
        <p>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Add" CssClass="btnViewU" />
            &nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label8" runat="server"></asp:Label>
       
        <asp:GridView ID="tbProduct" runat="server" 
              AutoGenerateColumns="False" DataKeyNames="PID"
              DataSourceID="SqlDataSource1" AutoGenerateDeleteButton="True" OnRowDeleting="tbProduct_RowDeleting" AutoGenerateSelectButton="True" OnSelectedIndexChanging="tbProduct_SelectedIndexChanging" Width="100px">
    <Columns>
    <asp:BoundField DataField="PID" HeaderText="PID" 
                InsertVisible="False" ReadOnly="True"
                               SortExpression="PID" />
    <asp:BoundField DataField="Name" HeaderText="Name" 
                               SortExpression="Name" />
        <asp:BoundField DataField="Price" HeaderText="Price" 
                               SortExpression="Price" />
    <asp:TemplateField HeaderText="Image" >
    <ItemTemplate>
    <asp:Image ID="Image1" runat="server" 
           ImageUrl='<%# "Handler.ashx?PID=" + Eval("PID")%>'/>
    </ItemTemplate>
    </asp:TemplateField>
        <asp:BoundField DataField="Stocked" HeaderText="Stocked" 
                               SortExpression="Stocked" />
        <asp:BoundField DataField="Description" HeaderText="Description" 
                               SortExpression="Description" />
    </Columns>
    </asp:GridView>
        </p>
                </td>
                    </tr>
                    <tr>
                        <td class="auto-style2"> 
       
                            &nbsp;</td>
                    </tr>
                </table>
       
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
    SelectCommand="SELECT [PID], [Name], [Price],[Image], [Stocked], [Description] 
              FROM [_Product]"
        DeleteCommand="DELETE FROM [_Product] where PID=@PID"></asp:SqlDataSource>
            </div>
        </div>
    </form>
</body>
</html>
